package org.dromara.system.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonValue;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;

@Getter
@AllArgsConstructor
public enum WithdrawalTypeEnums {

//    ALIPAY(1, "支付宝", "ALIPAY"),


    ;

    @JsonValue
    @EnumValue
    private final Integer code;

    private final String name;

    private final String serviceName;

    public static WithdrawalTypeEnums findOne(Integer code) {
        return Arrays.stream(WithdrawalTypeEnums.values())
                .filter(type -> type.getCode().equals(code)).findAny().orElse(null);
    }
}
